//+--------------------------------------------------------------------
//| Copyright(c) 2012 - an.vuongngocduy					
//| This file is a part of Compact Game Engine (CGE)	
//+--------------------------------------------------------------------
#ifndef __CGE_CANVASWIN_H__
#define __CGE_CANVASWIN_H__

#include "cgeCommons.h"
#include "cgeCanvas.h"
#include "cgeString.h"
#include "cgeRect.h"

using namespace cge::std;

namespace cge
{
	class CanvasWin : public Canvas
	{
	public:
		/// Default constructor
		CanvasWin();

		/// Destructor
		~CanvasWin();

		/// Return the window handle
		HWND GetHWND() const { return mWinHandle; } 

		/// Return device context handle
		HDC GetHDC() const { return mDevContext; }

		/// Initialize the window
		void Setup(const String& caption, const Vector2u& position, const Size2u& dimension);

		//! Show windows
		void Show();

		//! Dispatch OS messages
		void DistributeMessage();

		//! Handle system messages from MS-Windows OS
		static LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);

	private:
		Rectu mWinRect;
		HWND mWinHandle;
		HDC mDevContext;
	};
}

#endif//__CGE_CANVASWIN_H__